﻿<Window x:Class="WebCamViewer.WebCamWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    KeyDown="Window_KeyDown" 
        xmlns:wf="clr-namespace:BrainTechLLC.WebCam;assembly=WebCamLib2"
    Title="WebCamWindow" Height="580" Width="540">
    <Grid>
        <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Height="22">
            <TextBox Text="192.168.0.150" x:Name="txtAddress" MinWidth="120"/>
            <Button x:Name="btnConnect" Click="btnConnect_Click" Content="Connect" />
            <ToggleButton x:Name="btnTopmost" Checked="btnTopmost_Checked" Unchecked="btnTopmost_Unchecked" Content="Topmost"/>
            <TextBlock Margin="4,0,0,0" x:Name="txtWarning" Text="" FontSize="12" Foreground="DarkRed" />
            <TextBlock Margin="4,0,0,0" x:Name="txtMotion" Text="" FontSize="12" Foreground="DarkBlue" MouseLeftButtonDown="txtMotion_MouseLeftButtonDown" />
            <TextBlock Margin="4,0,0,0" x:Name="txtFPS" Text="" FontSize="12" Foreground="DarkGreen" />
            <ToggleButton x:Name="btnMovementAlarm" Content="Movement Alarm" Margin="4,0,0,0" Checked="btnMovementAlarm_Checked" Unchecked="btnMovementAlarm_Unchecked"/>
        </StackPanel>
        <WindowsFormsHost SizeChanged="formsHost_SizeChanged" x:Name="formsHost" Width="Auto" Height="Auto" Margin="0,22,0,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <WindowsFormsHost.Child>
                <wf:WebcamVideoControl SizeChanged="webCamControl_SizeChanged" x:Name="webCamControl" Width="640" Height="480" AlwaysOnTop="True" Load="webCamControl_Load"  />
            </WindowsFormsHost.Child>
        </WindowsFormsHost>

    </Grid>
</Window>
